
// #ifndef VUE3
import Vue from 'vue'
import App from './App'
// import store from './store/index.js'
import uView from '@/uni_modules/uview-ui'
import request from 'common/request.js'

// main.js
Vue.use(uView)

// Vue.prototype.$store = store
Vue.prototype.$request = request
Vue.config.productionTip = false
App.mpType = 'app'

// 配置请求拦截器
uni.addInterceptor('request', {
  // 在发送请求之前做一些处理
  config(requestConfig) {
	  const token=uni.getStorageSync('token')
    // 添加请求头、身份验证等
    requestConfig.header.Authorization = 'Bearer ' + token.token;
    return requestConfig;
  },
  // 请求发生错误时的处理
  fail(error) {
    console.error('请求失败:', error);
  },
});




const app = new Vue({
    ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import App from './App.vue'
import mixin from './uni_modules/uview-ui/libs/mixin/mixin'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif

